import {initLoading} from 'web-loading'

let dom = document.querySelector("#app")
let webLoading = initLoading({
  "type": "dom", "model": "Clock", "text": "加载中...", "textGap": 8, "fontSize": 13, 
  "fontFamily": "Microsoft YaHei", "delay": 65, 
  "delayColse": 520, "zIndex": "2001", "themeColor": "rgba(64,158,255,1)", 
  "bgColor": "rgba(0, 0, 0, 0.8)", "shadowColor": "rgba(64,158,255,0.6)", 
  "shadowOffsetX": 2, "shadowOffsetY": 2, "shadowBlur": 5, "pointerEvents": false, 
  "optimization": false, "lineWidth": 2, "lineCap": "round", "textTime": "s", 
  "lineColors": ["#d4d4d4", "#06ab2d", "#8a0303"], "clockSize": 19, "clockGap": 4, 
  "hLine": true, "mLine": false, "sLine": true
})

const show = function () {
  webLoading.loading(dom)
}

const hide = () => {
  webLoading.close()
}

export default {
  show, hide
}
